<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
		<style>
			.mui-input-group {
				margin-top: 20px;
			}
		</style>
	</head>

	<body>

		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title"><i class="mui-icon-extra mui-icon-extra-card"></i>捐助作者</h1>
			<link href="../css/icons-extra.css" rel="stylesheet" />
		</header>
		<div class="mui-content" id="app">
			<form class="mui-input-group">
				<div class="mui-input-row">
					<label>捐助作者</label>
					<input v-model="code" type="text" class="mui-input-clear" placeholder="请输入激活码">
				</div>

				<div class="mui-button-row">
					<button type="button" @tap="ok" class="mui-btn mui-btn-primary" onclick="return false;">确认</button>&nbsp;&nbsp;
					<button type="button" class="mui-btn mui-btn-danger mui-action-back" onclick="return false;">取消</button>
				</div>
			</form>
			<div class="desc" style="margin: 20px; color: #555555; font-size: 16px;">
				<div>亲爱的各位用户:</div>
				<div style="text-indent: 32px;">您们好!</div>
				<div style="text-indent: 32px;">本程序使用完全免费,您的捐助能为本程序完善的更好。激活CIP后可以得到解析路劲,完全享受广告,免费VIP电视功能。</div>
			</div>
		</div>
		<script src="../js/mui.min.js"></script>
		<script src="../js/vue.min.js"></script>
		<script src="../js/jQuery.js"></script>
		<script src="../js/common.js"></script>
		<script type="text/javascript">
			mui.init()
			mui.plusReady(function() {
				var vm = new Vue({
					el: "#app",
					data: {
						code: "",
					},
					methods: {
						ok: function() {
							var that = this; 
							postServer({
								url: requestUrl("/app/ActivationCode/active"),
								data: JSON.stringify({
									code: that.code
								}),
								success:function(result){
									if(result.success){
										mui.toast("充值成功,您的VIP时间增加"+result.result.timeLimit+"小时");
										that.code = "";
										plus.webview.currentWebview().opener().evalJS("vm.updateUser()")
									}else{
										mui.toast(result.msg);
									}
								}
							})
						}
					}
				})
			})
		</script>
	</body>

</html>